/*
 * @Author: your name
 * @Date: 2021-11-25 14:13:58
 * @LastEditTime: 2021-12-02 14:17:43
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \li-yuwei\client\src\api\article.js
 */
import request from "../utils/request";
//获取最新文章
function recommendArticle() {
    return request({
        url: "/api/client/recommend/article",
        method: "get",
    });
}
//获取全部文章
function getStateArticle() {
    return request({
        url: "/api/client/state/article",
        method: "get",
    });
}
//首焦推荐轮播图数据
function getFocusArticle() {
    return request({
        url: "/api/client/focus/article",
        method: "get",
    });
}
//搜索文章
function searchArticle(data) {
    return request({
        url: "/api/client/article",
        method: "get",
        params: {
            searchVal: data,
        },
    });
}
//文章详情
function getArticleDetail(id) {
    return request({
        url: `/api/article/${id}`,
        method: "get",
    });
}
//阅读量++
function addArticleReading(data) {
    return request({
        url: "/api/client/reading/article",
        method: "post",
        data,
    });
}
//点赞
function addArticleLikes(data) {
    return request({
        url: "/api/client/likes/article",
        method: "post",
        data,
    });
}
//是否点过赞
function isArticleLikes(data) {
    return request({
        url: "/api/client/isLikes/article",
        method: "post",
        data,
    });
}
export default {
    recommendArticle,
    getStateArticle,
    searchArticle,
    getArticleDetail,
    getFocusArticle,
    addArticleReading,
    addArticleLikes,
    isArticleLikes,
};